<?php
/**
* @package     mx_joofree9
* @author      mixwebtemplates
* @link        http://www.mixwebtemplates.com
* @license     GNU/GPL
*/

defined('_JEXEC') or die;
if(!defined('DS')){
define( 'DS', DIRECTORY_SEPARATOR );
}

JHTML::_('behavior.modal');
JHTML::_('behavior.framework', true);
JHtml::_('bootstrap.framework');

$app = JFactory::getApplication();
$max_sitewidth	= $this->params->get('max_sitewidth');
$showDefaultLogo	= $this->params->get('showDefaultLogo');
$defaultLogo 		= $this->params->get('defaultLogo');
$showMediaLogo		= $this->params->get('showMediaLogo');
$mediaLogo 			= $this->params->get('mediaLogo');
$showTextLogo		= $this->params->get('showTextLogo');
$textLogo 			= $this->params->get('textLogo');
$showSlogan 		= $this->params->get('showSlogan');
$slogan 			= $this->params->get('slogan');
$analyticsCode		= $this->params->get('analyticsCode');
$responsiveCode		= $this->params->get('responsiveCode');
$bodyFontSize		= $this->params->get('bodyFontSize');
$bodyFontFamily		= $this->params->get('bodyFontFamily');
$animspeed         = $this->params->get("animspeed");
$bg1            = $this->params->get("bg1");
$bg2            = $this->params->get("bg2");
$bg3            = $this->params->get("bg3");
$bg4            = $this->params->get("bg4");
$bg5            = $this->params->get("bg5");
$bg6            = $this->params->get("bg6");
$bg7            = $this->params->get("bg7");
$bg8            = $this->params->get("bg8");
$bg9            = $this->params->get("bg9");
$bg10            = $this->params->get("bg10");
$bg11            = $this->params->get("bg11");
$slidew         = $this->params->get("slidew");
$slideh         = $this->params->get("slideh");
$slides = $this->params->get('slides');
$slideseffect = $this->params->get('slideseffect');
$slidesimage1 = $this->params->get('slidesimage1');
$slidesimage2 = $this->params->get('slidesimage2');
$slidesimage3 = $this->params->get('slidesimage3');
$slidesimage4 = $this->params->get('slidesimage4');
$slidesimage5 = $this->params->get('slidesimage5');
$slidesimage6 = $this->params->get('slidesimage6');
$slidesimage7 = $this->params->get('slidesimage7');
$slidesimage8 = $this->params->get('slidesimage8');

if ($slidesimage1 || $slidesimage2 || $slidesimage3 || $slidesimage4 || $slidesimage5 || $slidesimage6 || $slidesimage7 || $slidesimage8) {
// use images from template manager
} else {
// use default images
$slidesimage1 = $this->baseurl . '/templates/' . $this->template . '/header/header01.jpg';
$slidesimage2 = $this->baseurl . '/templates/' . $this->template . '/header/header02.jpg';
}

$slideslink1 = $this->params->get('slideslink1');
$slideslink2 = $this->params->get('slideslink2');
$slideslink3 = $this->params->get('slideslink3');
$slideslink4 = $this->params->get('slideslink4');
$slideslink5 = $this->params->get('slideslink5');
$slideslink6 = $this->params->get('slideslink6');
$slideslink7 = $this->params->get('slideslink7');
$slideslink8 = $this->params->get('slideslink8');

$highlights1ModuleCount = $this->countModules('top_1 + top_2 + top_3 + top_4 + top_5 + top_6');
if($highlights1ModuleCount > 0) {$highlights1ModuleWidth = $highlights1ModuleCount;}

$maincontent1ModuleCount = $this->countModules('maintop_1 + maintop_2 + maintop_3 + maintop_4 + maintop_5 + maintop_6');
if($maincontent1ModuleCount > 0) {$maincontent1ModuleWidth = $maincontent1ModuleCount;}

$maincontent2ModuleCount = $this->countModules('mainbottom_1 + mainbottom_2 + mainbottom_3 + mainbottom_4 + mainbottom_5 + mainbottom_6');
if($maincontent2ModuleCount > 0) {$maincontent2ModuleWidth = $maincontent2ModuleCount;}

$bottomModuleCount = $this->countModules('bottom_1 + bottom_2 + bottom_3 + bottom_4 + bottom_5 + bottom_6');
if($bottomModuleCount > 0) {$bottomModuleWidth = $bottomModuleCount;}

$contentLeft = 0;
$contentRight = 0;

if($this->countModules('left') > 0) {
$contentLeft =	1;
}

if($this->countModules('right') > 0) {
$contentRight =	1;
}

$moduleWidthcomponentContent = "mx_componentWidth_".(4 - ($contentLeft + $contentRight));
$templateURL = str_replace('/','%',$this->baseurl."/templates/".$this->template);

?>

<!doctype html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/media/jui/css/bootstrap.css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/basics.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/load.css " type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/menu.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/setts.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/elements.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/typo.css" type="text/css" />
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/script.js"></script>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/js/slides.min.jquery.js"></script>
<style type="text/css">
header > .wrapper, #system-message-container, #mx-header, #main, footer,.mx_spB, #mx_headerWrapper { width: <?php echo $max_sitewidth ?>px; }
<?php if ($bodyFontSize != '' || $bodyFontFamily != '' ) { ?>
body { <?php if ($bodyFontSize != '')	{ ?> font-size: <?php echo htmlspecialchars($bodyFontSize); ?>;	<?php } ?><?php if ($bodyFontFamily != '')	{ ?> font-family: <?php echo htmlspecialchars($bodyFontFamily); ?>;	<?php } ?> }
<?php } ?>
</style>
<!-- Pulled from http://code.google.com/p/html5shiv/ -->
<!--[if lt IE 9]>
<script src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/html5.js"></script>
<![endif]-->

<?php
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPad')){
echo('
<style>	
ul.menu ul {display: none; padding: 0;width: auto;white-space: nowrap;position: absolute;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);box-shadow: 0 1px 3px rgba(0, 0, 0, .3);-pie-box-shadow: 0 2px 0px rgba(0, 0, 0, 0.15);}
.mx_dropmenu ul.menu li:hover > ul {display: block;	}
</style>
');
}?>
<?php if (($this->countModules('header') && $slides == 2) || ($slides == 1)): ?>
<style type="text/css">
#slideshow { width: <?php echo $slidew ?>px;}
.slides_container, .slides_container a, .slides_container img { width: <?php echo $slidew ?>px; height: <?php echo $slideh ?>px;}
</style>
<script type="text/javascript">
$(function(){
$('#slides').slides({
preload: true,
preloadImage: 'templates/<?php echo $this->template; ?>/images/loading-balls.gif',
play: <?php echo $animspeed ?>,
pause: 2500,
hoverPause: true<?php if ($slideseffect == 1): ?>,
effect: 'fade',
crossfade: true,
fadeSpeed: 900<?php endif; ?>
});
});
$(document).ready(function() {
$("#slides").hover(function() {
$(".slides_nav").css("display", "block");
},
function() {
$(".slides_nav").css("display", "none");
});
});
</script>
<?php endif; ?>	
<!--[if lt IE 9]>
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/ie_fixes.css.php" type="text/css" /><link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/ie9.php" type="text/css" media="screen,projection" />
<![endif]-->

</head>

<body id="body">
<div id="siteWrapper">
<header id="header">
<div class="wrapper container">
<div class="siteLogo">		
<?php if (($showDefaultLogo) !=0) : ?>				
<a class="defaultLogo" href="<?php echo $this->baseurl; ?>/"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo/<?php echo htmlspecialchars($defaultLogo);?>" style="border:0;" alt="" /></a>
<?php endif;?>
<?php if (($showMediaLogo) !=0) : ?>				
<a class="mediaLogo" href="<?php echo $this->baseurl; ?>/"><img src="<?php echo $this->baseurl ?>/<?php echo htmlspecialchars($mediaLogo);?>" style="border:0;" alt="" /></a>
<?php endif;?>
<?php if (($showTextLogo) !=0) : ?>				
<a class="textLogo" href="<?php echo $this->baseurl; ?>/"><?php echo htmlspecialchars($textLogo);?></a>
<?php endif;?>
<?php if (($showSlogan) !=0) : ?>				
<div class="slogan"><?php echo htmlspecialchars($slogan);?></div>
<?php endif;?>
</div>

<?php if ($this->countModules( 'search' )) : ?>
<div id="mx_hOut">
<div id="mx_hIn">
<jdoc:include type="modules" name="search" style="xhtml" />
</div>
</div>
<?php endif; ?>

<div class="mx_clearFR"></div>
<div id="mainMenu">
<jdoc:include type="modules" name="mainmenu" style="xhtml" />
</div>
<div class="cleartBoth"></div>
</div>
</header>

<jdoc:include type="message" />

<?php if (($this->countModules('header') && $slides == 2) || ($slides == 1)): ?>
<div id="mx-headerout">
<div id="mx-header">
<div id="slides">
<!-- You CAN NOT remove (or unreadable) this without mixwebtemplates.com permission. -->
<div id="mcpanel"> DESIGNED BY MIXWEBTEMPLATES </div>
<!-- You CAN NOT remove (or unreadable) this without mixwebtemplates.com permission. -->
<div class="slides_container">
<?php if ($slidesimage1): ?>
<?php if ($slideslink1): ?><a href="<?php echo $slideslink1; ?>"><?php endif;?><img src="<?php echo $slidesimage1; ?>" alt="<?php echo $slidescaption1; ?>" /><?php if ($slideslink1): ?></a><?php endif;?>
<?php endif;?>
<?php if ($slidesimage2): ?>
<?php if ($slideslink2): ?><a href="<?php echo $slideslink2; ?>"><?php endif;?><img src="<?php echo $slidesimage2; ?>" alt="<?php echo $slidescaption2; ?>" /><?php if ($slideslink2): ?></a><?php endif;?>
<?php endif;?>
<?php if ($slidesimage3): ?>
<?php if ($slideslink3): ?><a href="<?php echo $slideslink3; ?>"><?php endif;?><img src="<?php echo $slidesimage3; ?>" alt="<?php echo $slidescaption3; ?>" /><?php if ($slideslink3): ?></a><?php endif;?>
<?php endif;?>
<?php if ($slidesimage4): ?>
<?php if ($slideslink4): ?><a href="<?php echo $slideslink4; ?>"><?php endif;?><img src="<?php echo $slidesimage4; ?>" alt="<?php echo $slidescaption4; ?>" /><?php if ($slideslink4): ?></a><?php endif;?>
<?php endif;?>
<?php if ($slidesimage5): ?>
<?php if ($slideslink5): ?><a href="<?php echo $slideslink5; ?>"><?php endif;?><img src="<?php echo $slidesimage5; ?>" alt="<?php echo $slidescaption5; ?>" /><?php if ($slideslink5): ?></a><?php endif;?>
<?php endif;?>
<?php if ($slidesimage6): ?>
<?php if ($slideslink6): ?><a href="<?php echo $slideslink6; ?>"><?php endif;?><img src="<?php echo $slidesimage6; ?>" alt="<?php echo $slidescaption6; ?>" /><?php if ($slideslink6): ?></a><?php endif;?>
<?php endif;?>
<?php if ($slidesimage7): ?>
<?php if ($slideslink7): ?><a href="<?php echo $slideslink7; ?>"><?php endif;?><img src="<?php echo $slidesimage7; ?>" alt="<?php echo $slidescaption7; ?>" /><?php if ($slideslink7): ?></a><?php endif;?>
<?php endif;?>
<?php if ($slidesimage8): ?>
<?php if ($slideslink8): ?><a href="<?php echo $slideslink8; ?>"><?php endif;?><img src="<?php echo $slidesimage8; ?>" alt="<?php echo $slidescaption8; ?>" /><?php if ($slideslink8): ?></a><?php endif;?>
<?php endif;?>
</div>
<div class="slides_nav">
<a href="#" class="prev"></a>
<a href="#" class="next"></a>
</div>
</div>
</div>
</div>
<?php endif; ?>	
<!-- No Slides -->
<?php if ($this->countModules('header') && $slides == 0): ?>
<div id="mx-headerout">
<div id="mx-header">
<jdoc:include type="modules" name="header" />
</div>
</div>
<?php endif; ?>


<?php if ($this->countModules( 'info' )) : ?>
<div id="mx_headerWrapper">
<div id="mx_headerContent">
<jdoc:include type="modules" name="info" style="xhtml" />
</div>
</div>
<?php endif; ?>

<div id="main">
<div class="wrapper container">
<?php if ($this->countModules( 'top_1 or top_2 or top_3 or top_4 or top_5 or top_6' )) : ?>
<section>
<div class="row colWidth_<?php echo $highlights1ModuleWidth ?>">
<?php if ($this->countModules( 'top_1' )) : ?>
<jdoc:include type="modules" name="top_1" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'top_2' )) : ?>
<jdoc:include type="modules" name="top_2" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'top_3' )) : ?>
<jdoc:include type="modules" name="top_3" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'top_4' )) : ?>
<jdoc:include type="modules" name="top_4" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'top_5' )) : ?>
<jdoc:include type="modules" name="top_5" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'top_6' )) : ?>
<jdoc:include type="modules" name="top_6" style="xhtml" />
<?php endif; ?>
</div>
</section>
<div class="mx_clearFL"></div>
<?php endif; ?>
<?php if ($this->countModules( 'maintop_1 or maintop_2 or maintop_3 or maintop_4 or maintop_5 or maintop_6' )) : ?>
<section>
<div class="row colWidth_<?php echo $maincontent1ModuleWidth ?>">
<?php if ($this->countModules( 'maintop_1' )) : ?>
<jdoc:include type="modules" name="maintop_1" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'maintop_2' )) : ?>
<jdoc:include type="modules" name="maintop_2" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'maintop_3' )) : ?>
<jdoc:include type="modules" name="maintop_3" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'maintop_4' )) : ?>
<jdoc:include type="modules" name="maintop_4" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'maintop_5' )) : ?>
<jdoc:include type="modules" name="maintop_5" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'maintop_6' )) : ?>
<jdoc:include type="modules" name="maintop_6" style="xhtml" />
<?php endif; ?>
</div>
</section>
<?php endif; ?>
<section>
<div class="row_main">
<?php if ($this->countModules( 'left' )) : ?>
<div class="mx_left">
<jdoc:include type="modules" name="left" style="xhtml" />
</div>
<?php endif; ?>
<div class="mx_componentContent <?php echo $moduleWidthcomponentContent?>">
<?php if ($this->countModules( 'breadcrumbs' )) : ?>
<div class="mx_breadcrumbs">
<jdoc:include type="modules" name="breadcrumbs" style="xhtml" />
</div>
<?php endif; ?>
<div class="inner">
<jdoc:include type="component" />
</div>
</div>
<?php if ($this->countModules( 'right' )) : ?>
<div class="mx_right">
<jdoc:include type="modules" name="right" style="xhtml" />
</div>
<?php endif; ?>
<div class="cleartBoth"></div>
</div>
</section>
<?php if ($this->countModules( 'mainbottom_1 or mainbottom_2 or mainbottom_3 or mainbottom_4 or mainbottom_5 or mainbottom_6' )) : ?>
<section>
<div class="row colWidth_<?php echo $maincontent2ModuleWidth ?>">
<?php if ($this->countModules( 'mainbottom_1' )) : ?>
<jdoc:include type="modules" name="mainbottom_1" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'mainbottom_2' )) : ?>
<jdoc:include type="modules" name="mainbottom_2" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'mainbottom_3' )) : ?>
<jdoc:include type="modules" name="mainbottom_3" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'mainbottom_4' )) : ?>
<jdoc:include type="modules" name="mainbottom_4" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'mainbottom_5' )) : ?>
<jdoc:include type="modules" name="mainbottom_5" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'mainbottom_6' )) : ?>
<jdoc:include type="modules" name="mainbottom_6" style="xhtml" />
<?php endif; ?>
</div>
</section>
<?php endif; ?>
<div class="mx_clearFL"></div>
<?php if ($this->countModules( 'bottom_1 or bottom_2 or bottom_3 or bottom_4 or bottom_5 or bottom_6' )) : ?>
<section>
<div class="row colWidth_<?php echo $bottomModuleWidth ?>">
<?php if ($this->countModules( 'bottom_1' )) : ?>
<jdoc:include type="modules" name="bottom_1" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'bottom_2' )) : ?>
<jdoc:include type="modules" name="bottom_2" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'bottom_3' )) : ?>
<jdoc:include type="modules" name="bottom_3" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'bottom_4' )) : ?>
<jdoc:include type="modules" name="bottom_4" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'bottom_5' )) : ?>
<jdoc:include type="modules" name="bottom_5" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules( 'bottom_6' )) : ?>
<jdoc:include type="modules" name="bottom_6" style="xhtml" />
<?php endif; ?>
</div>
</section>
<?php endif; ?>
</div>
</div>
<div class="mx_spB"></div>
<footer>
<section>  
<div id="copyright" class="clearfix"><!--copyright starts here-->
<?php require("footer.php"); ?>
</div><!--copyright ends here-->  
</section>
</footer>
</div>

</body>
</html>